﻿using System.Net;
using System.Net.Http;

namespace ARC.YunXinShi.SMSService.Service
{
    public class BaseYunXinShi
    {
        protected string Post(string url, string paramsDictionary)
        {
            var hanDer = new HttpClientHandler()
            {
                AutomaticDecompression = DecompressionMethods.GZip,
            };
            using (HttpClient client = new HttpClient(hanDer))
            {
                //HttpContent httpContent = new StringContent(paramsDictionary);
                //httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
                var response = client.GetAsync(url + "?" + paramsDictionary); //创建响应对象
                string json = response.Result.Content.ReadAsStringAsync().Result; //响应的结果
                return json;
            }
        }
    }
}
